export const option = {
    grid: {
        top: '20px',
        left: '0',
        right: '0',
        bottom: '24px',
        containLabel: true
    },
    tooltip: {
        formatter: "{a} <br/>{b}: {c} ({d}%)",
        trigger: 'axis', //坐标轴触发，主要在柱状图，折线图等会使用类目轴的图表中使用
        axisPointer: {// 坐标轴指示器，坐标轴触发有效
            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
        }
    },

    xAxis: {
        position: 'right',
        boundaryGap: true,
        axisTick: {
            show: false // 隐藏x轴刻度线
        },

        type: 'category',
        data: []
    },
    yAxis: {
        scale: true,
        // boundaryGap: false,
        axisTick: {
            show: false // 隐藏x轴刻度线
        },
        axisLine: {
            show: false, // 隐藏Y轴实线
        },
        type: 'value',

    },
    series: [
        {
            symbol: "none",
            data: [],
            type: 'bar',
            lineStyle: { // 设置线条的style等
                normal: {
                    color: '#1890ff', // 折线线条颜色:红色
                },
            },
            color: {
                type: 'linear',
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [{
                    offset: 0, color: 'rgba(24, 144, 255, 0.85)' // 0% 处的颜色
                }, {
                    offset: 1, color: 'rgba(53, 176, 255, 0.25)' // 100% 处的颜色
                }],
                global: false // 缺省为 false
            }
        },
    ]
};

// rgba(57, 167, 255, 0.85)
// rgba(255, 185, 0, 0.85)
// rgba(0, 110, 255, 0.85)
// rgba(0, 205, 134, 0.85)
// rgba(255, 127, 61, 0.85)
export const pieOption = {
    grid: {
        top: '20px',
        left: '0',
        right: '0',
        bottom: '24px',
        containLabel: true
    },
    tooltip: {
        // trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    series: [
        {
            name: '告警统计',
            type: 'pie',
            radius: '80%',
            data: [
                // { value: 1048, name: 'Search Engine' },
                // { value: 735, name: 'Direct' },
                // { value: 580, name: 'Email' },
                // { value: 484, name: 'Union Ads' },
                // { value: 300, name: 'Video Ads' }
            ],
            itemStyle: {
                normal: {
                    color: function (colors) {
                        var colorList = [
                            'rgba(57, 167, 255, 0.85)',
                            'rgba(255, 185, 0, 0.85)',
                            'rgba(0, 110, 255, 0.85)',
                            'rgba(0, 205, 134, 0.85)',
                            'rgba(255, 127, 61, 0.85)',
                        ];
                        return colorList[colors.dataIndex];
                    }
                },
            },
            label: {
                show: false
            },
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
}